﻿
@{
    ViewBag.Title = "IssueReportAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="FacAndEquController" ng-init="AddModel={};
     PageName='@(Request.QueryString["pagename"].IsEmpty() ? "" : Request.QueryString["pagename"])';
     RoomId='@(Request.QueryString["RoomId"].IsEmpty() ? "" : Request.QueryString["RoomId"])';
      Type='@(Request.QueryString["Type"].IsEmpty() ? "" : Request.QueryString["Type"])';
     GetParkList();
     GetDeviceStatusList();
     AddModel.ReportTime='@DateTime.Now.ToString("yyyy-MM-dd HH:mm")';
     GetCompanyList();
     GetDeviceTypeList();
     BindDepartmentList('dep_select');
     AddModel.Status='1';
     AddModel.DeviceType = Type;
	 AddModel.RoomId=RoomId;
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>添加设施设备</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>设施设备</a></li>
        <li><a>消防器材</a></li>
        <li class="active"><a>添加设施设备</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>添加设施设备</h2></div>
                        <div class="panel-body">
                            <div class="form-group" ng-show="RoomId==''">
                                <label class="col-sm-1 control-label">园区：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="AddModel.ParkId" ng-change="GetPlaceList('placelist',AddModel.ParkId);">
                                        <option value="">选择园区</option>
                                        <option ng-repeat="x in ParkList" value="{{x.Id}}">{{x.ParkName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group" ng-show="RoomId==''">
                                <label class="col-sm-1 control-label">场所：</label>
                                <div class="col-sm-8">
                                    <select id="placelist" class="selectpicker show-tick form-control" ng-model="AddModel.RoomId" data-live-search="true">
                                        <option value="" selected>请选择场所</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">管理部门：</label>
                                <div class="col-sm-8">
                                    <select id="dep_select" class="selectpicker show-tick form-control" ng-model="AddModel.DepartmentId" data-live-search="true">
                                        <option value="" selected>请选择管理部门</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">管理频次：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="AddModel.ManageInterval">
                                        <option value="" selected>请选择管理频次</option>
                                        <option value="每日" selected>每日</option>
                                        <option value="每周" selected>每周</option>
                                        <option value="每月" selected>每月</option>
                                        <option value="每年" selected>每年</option>
                                        <option value="其他" selected>其他</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">设备类型：</label>
                                <div class="col-sm-8">
                                    <select id="placelist" class="form-control" ng-model="AddModel.DeviceType" ng-disabled="Type!=''">
                                        <option value="" selected>请选择设备类型</option>
                                        <option ng-repeat="x in DeviceTypeList" value="{{x.Id}}">{{x.DeviceType}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">设备号：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.DeviceNo" ng-init="AddModel.DeviceNo=''" maxlength="500" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">设备名称：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.DeviceName" ng-init="AddModel.DeviceName=''" maxlength="500" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">型号：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.ModelNo" ng-init="AddModel.ModelNo=''" maxlength="500" />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">数量：</label>
                                <div class="col-sm-8">
                                    <input type="number" class="form-control" ng-model="AddModel.Quantity" ng-init="AddModel.Quantity=0" maxlength="500" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">维保公司：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="AddModel.CompanyId">
                                        <option value="" selected>请选择维保公司</option>
                                        <option ng-repeat="x in CompanyList" value="{{x.Id}}">{{x.CompanyName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">维保频次：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="AddModel.MaintenanceInterval">
                                        <option value="" selected>请选择维保频次</option>
                                        <option value="每日" selected>每日</option>
                                        <option value="每周" selected>每周</option>
                                        <option value="每月" selected>每月</option>
                                        <option value="每年" selected>每年</option>
                                        <option value="按需" selected>按需</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">当前状态：</label>
                                <div class="col-sm-8">
                                    <select id="placelist" class="form-control" ng-model="AddModel.Status">
                                        <option ng-repeat="x in StatusList" value="{{x.Id}}">{{x.StatusName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">下次维保日期：</label>
                                <div class="col-sm-8">
                                    <datepicker id="startTime" option="datetimeOption" format="L" ng-model="AddModel.NextMaintainceDate"></datepicker>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="AddModel.Remark" ng-init="AddModel.Remark=''" maxlength="500" />
                                </div>
                                <label class="control-label">{{AddModel.Remark.length}}/500</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">排序：</label>
                                <div class="col-sm-8">
                                    <input type="number" class="form-control" ng-model="AddModel.SortBy" ng-init="AddModel.SortBy=0" />
                                </div>
                            </div>
                            <div class="panel-footer">
                                <div class="col-sm-2">
                                </div>
                                <div class="col-sm-2">
                                    <button ng-click="AddDeiveForm(AddModel,PageName);" class="btn btn-primary">提交</button>
                                </div>
                                <div class="col-sm-2">
                                    <a href="javascript:history.back(-1)" class="btn btn-default">返回</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>
</div>


@section Js{
    <script src="~/Assets/js/pg/FacAndEqu.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
    </script>
}


